/* ============ 图表容器 ============ */

.chart-wrapper {
    width: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.chart-wrapper canvas {
    max-width: 100%;
    height: auto;
}

/* ============ 图表控制栏 ============ */

.chart-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.chart-controls select,
.chart-controls button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.chart-controls select:hover,
.chart-controls button:hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.chart-controls button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ============ 图表类型按钮 ============ */

.chart-type-buttons {
    display: flex;
    gap: 8px;
}

.chart-type-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.chart-type-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.chart-type-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ============ 图表标题 ============ */

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

/* ============ 响应式 ============ */

@media (max-width: 768px) {
    .chart-wrapper {
        padding: 16px;
    }
    
    .chart-controls {
        flex-direction: column;
    }
    
    .chart-controls select,
    .chart-controls button {
        width: 100%;
    }
    
    .chart-type-buttons {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .chart-type-btn {
        flex: 1;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .chart-wrapper {
        padding: 12px;
    }
    
    .chart-title {
        font-size: 16px;
    }
    
    .chart-controls select,
    .chart-controls button {
        font-size: 12px;
        padding: 6px 12px;
    }
}
